/*
 * @Description:
 * @Author: shizhe
 * @Date: 2021-09-06 20:09:03
 * @LastEditTime: 2022-07-01 09:55:36
 * @LastEditors: shizhe
 * @Reference:
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Api from './utils/request'

import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.prototype.$https = Api
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import Print from 'vue-print-nb'
import glo from './utils/global'
Vue.prototype.GLOBAL = glo
import VueJsonp from 'vue-jsonp'
import echarts from 'echarts'
import globalSocket from './utils/globalSocket'
import common from './utils/common.js'

//全局引入公共方法
Vue.prototype.common = common
// 全局引入ws
Vue.prototype.globalSocket = globalSocket
// ws事件总线
Vue.prototype.socketEventBus = new Vue()

Vue.prototype.$echarts = echarts
Vue.use(VueJsonp)
Vue.use(Print)
Vue.use(ElementUI)
Vue.config.productionTip = false

// router.beforeEach((to, from, next) => {
//   const role = common.getCookie('token');
//   if (!role && to.path !== '/login') {
//     if (to.path == '/register' || to.path == '/perfectInfo') {
//       next()
//     } else {
//       next('/login');
//     }
//   } else {
//     next()
//   }
// });

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
